package util;

import java.util.Date;

/**
 * Java String 类中常用的静态方法
 */
public class StringUtils {
    public static void main(String[] args) {
        testValueOf();
        testFormat();
    }

    private static void testFormat() {
        String s = String.format("姓名：%s，年龄：%d", "小明", 18);
        System.out.println(s);
        Date date = new Date();
        System.out.println(String.format("%tF", date));
        System.out.println(String.format("%tT", date));
    }

    private static void testValueOf() {
        System.out.println("String.valueOf(1) = " + String.valueOf(1));
    }


}
